<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 这个区域被vue控制 -->
        <ul>
            <li v-for="(item,index) in arr">{{item}}</li>
        </ul>
        <button @click="exchange">走一走</button>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            // vue的配置对象
            el: '#app',
            data: {
                arr: ['帅哥', '美女', '程序猿']
            },
            methods:{
                exchange(){
                    this.arr.push(this.arr[0])
                    this.arr.shift(this.arr[0])
                }
            }
        })
    </script>
</body>

</html>